cmake_minimum_required(VERSION 3.8)

PROJECT(luafmt)
INCLUDE(cmake/ModuleImport.cmake)
INCLUDE(cmake/LuaModule.cmake)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModuleCompileOptions.cmake)
ModuleSetCompileOptions()

SET(LUA_MODULE lua53)
SET(LUAFMT_VERSION_MAJOR "1")
SET(LUAFMT_VERSION_MINOR "0")
SET(LUAFMT_VERSION_PATCH "1")
SET(LUAFMT_VERSION "${LUAFMT_VERSION_MAJOR}.${LUAFMT_VERSION_MINOR}.${LUAFMT_VERSION_PATCH}")

MESSAGE(STATUS "VERSION: ${LUAFMT_VERSION}")

ADD_DEFINITIONS(-DUSE_LUAFMT)
ADD_DEFINITIONS(-DLUA_COMPAT_MODULE -DLUA_COMPAT_APIINTCASTS)

ModuleImport("dmlog" "thirdparty/dmlog")
LuaModuleImport("${LUA_MODULE}" "luafmt" "src/luafmt" "")

